package asteroids.engine;

import java.awt.Graphics;
import java.util.ArrayList;

public interface ObjectManager<E>
{
    /*
     * Each implementer should have classes similar to these, but the varying
     * controlled types make this difficult, especially since
     * ArrayList<subclass> can't be used in place of ArrayList<class>
     */
    public void add(E obj);

    public void addAll(ArrayList<? extends E> all);

    /**
     * returns an ArrayList of the currently-held objects
     * 
     * @return
     */
    public ArrayList<E> getObjects();

    /**
     * draw each controlled object
     * 
     * @param g
     */
    public void draw(Graphics g);

    /**
     * get rid of all contained objects
     */
    public void clear();

    /**
     * erase the previous image of each controlled object
     * 
     * @param g
     */
    public void erase(Graphics g);

    /**
     * update each of the controlled objects
     */
    public void update();
}